package com.contract.spirit.ui.invite

import androidx.lifecycle.MutableLiveData
import com.contract.commonlib.http.status.ResultState
import com.contract.commonlib.base.BaseViewModel
import com.contract.commonlib.http.ext.request
import com.contract.spirit.bean.response.InviteRecordResponse
import com.contract.spirit.func.net.rxApi

/**
 * @author: zhengjun
 * created: 2021/9/22
 * desc:
 */
class InviteViewModel : BaseViewModel() {
    var inviteRecordRes = MutableLiveData<ResultState<InviteRecordResponse>>()
    fun getInviteUserInfo(currentPage: Int) {
        request(
            { rxApi.getInviteUserInfo(currentPage.toString()) },
            inviteRecordRes,
            inviteRecordRes.value == null
        )
    }
}